<template>
  <div class="container">
    <div class="container__header">
      <Header :currentId="3" />
    </div>
    <div class="container-body">
      <div class="day">
        <div class="day-item">
          <div class="day-title">
            <img src="@/assets/biaoti@2x.png" />
            <div class="text">
              <span class="font18">人员频次情况：{{str}}</span>
              <span class="count">{{ count }}人</span>
            </div>
          </div>
          <div class="servo-list">
            <div v-for="(item,index) in dataList" :key="index">
              <div class="item">
                <el-image
                    style="width: 140px; height: 140px; padding: 10px 0 10px"
                    :src="item.path"
                    :preview-src-list="[item.path]"
                    fit="fit">
                </el-image>
                <div class="mes">
                  <div class="username">{{ item.name }}</div>
                  <div class="durtime"><span class="time count-time">{{ item.times }}次</span></div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { mapGetters } from "vuex";

import Header from "@/components/Header.vue";

export default {
  name: "frequencyCount",
  components: {
    Header,
  },
  computed: { ...mapGetters(["userId"]) },

  data() {
    return {
      str: "",
      count:0,
      dataList:[],
    };
  },

  created() {
    this.getData()
  },

  methods: {
    getData() {
      this.str = this.$route.params.str;
      this.count = this.$route.params.count;
      this.dataList = this.$route.params.data;
    }
  }
};
</script>


<style lang="scss" scoped>
.container {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  .container-body{
    .day{
      padding: 15px;
      margin: 20px 20px 0 20px;
      background-color: #303136;
      border-radius: 10px;
      .day-item{
        .day-title{
          display: flex;
          gap: 5px;
          img{
            width: 24px;
            height: 24px;
          }
          .text{
            display: flex;
            span{
              text-align: left;
              width: 160px;
              color: #ffffff;
              font-size: 18px;
            }
            .count {
              margin-left: 20px;
            }
          }
        }
        .servo-list{
          margin-top: 10px;
          display: flex;
          flex-wrap: wrap;
          gap: 20px;
          .item{
            padding: 10px 20px;
            display: flex;
            flex-direction: column;
            align-items: center;
            border: 1px #45777A solid;
            border-radius: 5px;
            gap: 5px;
            background: #363940CC;
            .mes {
              font-size: 16px;
              width: 100%;
              color: #ffffff;
              display: flex;
              justify-content: flex-start;
              flex-wrap: wrap;
            }
            .durtime {
              margin-left: 40px;
            }

            span{
              color: #ffffff;
            }

            .mestime {
              margin: 4px 0 0 -26px;
            }
            .time {
              color: #949BA4;
              font-size: 14px;
            }
            .daytime {
              font-size: 14px;
            }
          }
        }
      }
    }
  }

}
</style>
